import 'package:flutter/cupertino.dart';
import 'package:hitutor/Util/Global.dart';
import 'package:hitutor/Util/MyColor.dart';
import 'package:hitutor/Widget/MyImage.dart';

class ChooserBox extends StatelessWidget {
  String? text;
  String? hintText;
  Function()? onTap;
  EdgeInsetsGeometry? margin;
  Color? bgColor;

  ChooserBox(this.text, {this.onTap, this.hintText, this.bgColor, this.margin});

  @override
  Widget build(BuildContext context) {
    String hint = hintText ?? "";
    String t = text ?? "";
    return GestureDetector(
        onTap: onTap,
        child: Container(
            decoration: Global.getBg(bgColor ?? MyColor.F2, 5),
            padding: EdgeInsets.fromLTRB(4, 6, 8, 6),
            margin: margin,
            child: Row(children: [
              Expanded(child: Text(t.isEmpty ? hint : t, style: TextStyle(fontSize: 12, color: MyColor.C58))),
              LocalImage("arrowdown.png", width: 12)
            ])));
  }
}
